using System;
using FluentNHibernate.Conventions;
using FluentNHibernate.Mapping;

namespace Webshop20.Infrastructure.Persistence.NH.AutoMappings.Conventions.Common
{
    public class EnumMappingConvention : IUserTypeConvention
    {

        public bool Accept(IProperty target)
        {

            return target.PropertyType.IsEnum;

        }

        public void Apply(IProperty target)
        {

            target.CustomTypeIs(target.PropertyType);

        }

        public bool Accept(Type type)
        {

            return type.IsEnum;

        }

    }
}